home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / bbsutil / acf540r0.zip / SCANZIP.BAT < prev    next >
DOS Batch File  |  1992-01-17  |  4KB  |  175 lines

  1. @echo off
  2. REM ----------------------------------------------------------------------
  3. REM ACFExtended Batch for ACFiles
  4. REM
  5. REM Arguments: %1 - Path to File,
  6. REM Arguments: %2 - Filename,
  7. REM Arguments: %3 - Filename Without .EXT
  8. REM Arguments: %4 - Extension of Filename (No ., just EXT)
  9. REM
  10. REM This one does just about everything you want 8-)
  11. REM It converts to ZIP, scans for viri, etc.
  12. REM ----------------------------------------------------------------------
  13. :
  14. :Make file have today's date
  15. :
  16. newdate %1%2
  17. :
  18. REM ----------------------------------------------------------------------
  19. :
  20. :Check For ARC/LZH/PAK/ZOO/ZIP Files
  21. :IF One of those, goto ZIP for Conversion
  22. :
  23. :Set Default Return Message
  24. :
  25. if %4 == ZIP acf_ret MSG No Conversion Needed/No Viri - Thanks!
  26. :
  27. :
  28. if %4 == ARJ goto zip
  29. if %4 == ARC goto zip
  30. if %4 == LZH goto zip
  31. if %4 == PAK goto zip
  32. if %4 == ZOO goto zip
  33. if %4 == ZIP goto zip
  34. :
  35. REM ----------------------------------------------------------------------
  36. :
  37. : If no conversion needed, end
  38. :
  39. : Tell them thanks for using the normal format..
  40. :
  41. acf_ret MSG No conversion required - Thanks!
  42. :
  43. :
  44. : Was not a recognizable archive format - going to end
  45. : If you want you may scan .EXE's as well for viri at this stage.
  46. : Simply run SCAN on the file and check the errorlevel.  If all
  47. : goes well, go to end.  Otherwise GOTO VIRUS
  48. :
  49. :
  50. scan %2 /NOMEM
  51. :
  52. if errorlevel 1 goto virus
  53. :
  54. :
  55. :
  56. goto end
  57. :
  58. REM ----------------------------------------------------------------------
  59. :
  60. REM ZIP - This Converts to .ZIP, Scans via. McAffee's Scan
  61. :
  62. :zip
  63. md 1111
  64. cd 1111
  65. if %4 == ARJ arj e %1%3
  66. if %4 == LZH lha e %1%3
  67. if %4 == PAK pak e %1%3
  68. if %4 == ZOO zoo e %1%3
  69. if %4 == ARC pkxarc %1%3
  70. if %4 == ZIP pkunzip %1%3
  71. :
  72. REM ----------------------------------------------------------------------
  73. :
  74. : You do NOT need to do PKUNZIP unless you want to scan for viri
  75. : on the file.
  76. :
  77. : This stage will scan for viri for all files in the package.
  78. : SCAN returns back ErrorLevel 1 if virus found.
  79. :
  80. :
  81. scan *.* /NOMEM
  82. :
  83. : If Bad, Go To Parent Diretory and call The Virus Found Routine
  84. :
  85. if errorlevel 1 cd ..
  86. if errorlevel 1 goto virus
  87. :
  88. REM ----------------------------------------------------------------------
  89. :
  90. : At this point we know it doesn't contain a known virus.
  91. :
  92. : If not ZIP file, then convert to .ZIP
  93. :
  94. if not %4 == ZIP pkzip %1%3 *.*
  95. :
  96. : Here we can put on a BBS advertisement
  97. : The BBS advertisement in this case is E:\ACFILES\BBSAD
  98. : We use Redirection here.
  99. :
  100. :pkzip -z %1%3 <e:\acfiles\bbsad
  101. :
  102. :
  103. : Return to parent directory where we started - where RETURN.ACF
  104. : resides.
  105. :
  106. cd ..
  107. :
  108. :
  109. : Clean directory 1111
  110. :
  111. :
  112. cleandir 1111
  113. :
  114. :
  115. : Delete file if it was converted (not .ZIP already)
  116. :
  117. if not %4 == ZIP del %1%2
  118. :
  119. :
  120. : This returns back the new filename as well as a sweet little ol' msg.
  121. :
  122. :
  123. acf_ret NAME %3.ZIP
  124. if not %4 == ZIP acf_ret MSG File Converted To .ZIP - Thanks for Waiting!
  125. :
  126. :Now we go to the end of the batch file.
  127. :
  128. goto end
  129. :
  130. REM ----------------------------------------------------------------------
  131. :
  132. :virus
  133. :
  134. :
  135. : Now we can run ACF_RET To Return Various Information
  136. :
  137. : The following tells ACFiles not to add the filename to the
  138. :    files.bbs (DELETE)
  139. :
  140. : Then it returns a message that a virus was found.
  141. :
  142. : Next it gives them no credit for the upload.
  143. : It also gives back 0 time credit ratio (valid for First U/L Only)
  144. :
  145. acf_ret DELETE
  146. acf_ret MSG Virus Found - Deleted!
  147. acf_ret NOCREDIT
  148. acf_ret TIME 0
  149. :
  150. :
  151. : Now let's delete the file..Optionally you could perhaps move
  152. : the file elsewhere for you to look over.
  153. :
  154. del %1%2
  155. :
  156. : Note ACFiles does not delete the file - it is up to the batch
  157. : file to do that operation.  DELETE only states not to put the
  158. : entry into the FILES.BBS
  159. :
  160. :
  161. : Now let's clean up the temp. directory made.
  162. :
  163. cleandir 1111
  164. :
  165. : And finally we end the batch file
  166. :
  167. goto end
  168. :
  169. REM ----------------------------------------------------------------------
  170. :
  171. :end
  172. :
  173. REM ----------------------------------------------------------------------
  174.  
  175.